/**
 * Copyright (c) 2014-2015, Suredy technology Co., Ltd. All rights reserved.
 * @author ZhangMaoren 
 * @since 2015年6月17日
 * @version 0.1
 */
package com.suredy.base.ctrl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.suredy.base.model.User;
import com.suredy.base.service.UserSrv;
import com.suredy.core.ctrl.BaseCtrl;


/**
 * @author ZhangMaoren
 *
 */
@Controller
@RequestMapping(value="config")
public class UserCtrl extends BaseCtrl{
//	private final static Logger log = LoggerFactory.getLogger(UserCtrl.class);
	@Autowired
	private UserSrv service;
	/**
	 * get user list
	 * 
	 * @param type
	 * @param page
	 * @return
	 */
	@RequestMapping(value = "user-list")
	public ModelAndView getUsers() {
		ModelAndView view = new ModelAndView("config/user-list");
		List<User> data = this.service.getAll();
		view.addObject("data", data);
		return view;
	}
}
